<!-- 组织机构管理-->
<div id="orgPage" class="layui-row">
    <div class="layui-col-md12">
        <div class="layui-col-md4">
            <table class="layui-hide" id="orgTable" lay-filter="orgTable"></table>
        </div>
    </div>
    <div class="layui-col-md12" style="margin: 28px 0 0 0;"></div>
</div>
<script>
    layui.use(['table', 'tableEdit', 'tableTree', 'form', 'tree', 'util', 'base','index'], function(){
      var table = layui.table
       ,tableEdit = layui.tableEdit
       ,tableTree = layui.tableTree
       ,form = layui.form
       ,tree = layui.tree
       ,layer = layui.layer
       ,util = layui.util
       ,index = layui.index
       ,$ = layui.$
       ,base = layui.base;

       //组织机构列表
       var renderTable = tableTree.render({
            elem: '#orgTable',
            id:'orgTable',
            method: 'post',
            url: '/baseService/org/tableTree',
            page: true,
            treeConfig: {
                showField:'name' //表格树显示的字段
                ,treeid:'id' //treeid所对应字段的值在表格数据中必须是唯一的，且不能为空。
                ,treepid:'parentId'//父级id字段名称
                ,iconClass:'layui-icon-triangle-r' //小图标class样式 窗口图标 layui-icon-layer
            },
            cols: [[ 
                {type:'checkbox'},
                {field: 'name', title: '机构名称'}
            ]],
            response: {
                statusCode: 200 //规定成功的状态码，默认：0
            },
            done: function (res, curr, count) {
                tableTree.openAllRows();
            }
        });

        renderTable.openAllRows();

    });
</script>